<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>

<!-- ========================= -->
<!-- root element: quotationAcknowledgement -->
<!-- ========================= -->


<xsl:template match="quotationAcknowledgement">

	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:variable name="approveImagePath" select="approveImage"/>
	<fo:layout-master-set>
		<fo:simple-page-master master-name="simpleA4"
        		page-height="11in"
        		page-width="8.5in"
        		margin-top="20mm"
        		margin-bottom="20mm"
      			margin-left="7mm"
      			margin-right="10mm" >

			<fo:region-after extent="3mm"/>
            <xsl:if test="@approve='0'">
                <fo:region-body/>
                </xsl:if>

                <xsl:if test="@approve='1'">
                <fo:region-body background-image="{$approveImagePath}" />
                </xsl:if>
  		</fo:simple-page-master>
         <fo:simple-page-master master-name="termsAndConditionsMasterName"
        		page-height="9in"
        		page-width="11.69in"
        		margin-top="5mm"
        		margin-bottom="0.30in"
      			margin-left="7mm"
      			margin-right="10mm" >
            <fo:region-before extent="0mm"/>
			<fo:region-after extent="3mm"/>
			<fo:region-body margin-top="0mm" margin-bottom="0.65in"/>
          </fo:simple-page-master>
    </fo:layout-master-set>




<fo:page-sequence master-reference="simpleA4">

<!--============================== -->
<!-- Page Number block             -->
<!-- Modified By Basha (12/24/2003)-->
<!--============================== -->

<fo:static-content flow-name="xsl-region-after">
	<fo:block font-size="7pt" font-weight="bold" text-align="right">
        Page <fo:page-number />
	<!--
	<xsl:value-of select="count(/packingSlip/lineItems/lineItem)"/>
	-->
	 of
	<fo:page-number-citation ref-id="endofdoc"/>

	<!--
	<fo:page-number-citation ref-id="last-page"/>
	-->

        </fo:block>
</fo:static-content>

<fo:flow flow-name="xsl-region-body">

<!--==============================-->
<!-- Logo and Self address block  -->
<!-- Modified By Prabhanjan (12/24/2003)-->
<!--==============================-->

	<fo:block font-size="8pt" space-after="1cm">
	<fo:table table-layout="fixed" width="100%" >

	<fo:table-column column-width="10mm" />
	<fo:table-column column-width="35mm"/>
	<fo:table-column column-width="20mm" />
	<fo:table-column display-align="center" />
	<fo:table-column />

	<fo:table-body>
		<fo:table-row>
			<fo:table-cell />

			<fo:table-cell>
			<!--
				<fo:external-graphic src="url('../jsp/includes/images/scalar_logo.jpg')" content-height = ".5in"  content-width = ".5in" />
                        -->
<!-- 			<fo:external-graphic src="url('file:c:///scalar_logo.jpg')" content-height = ".5in"  content-width = ".5in" /> -->

			<xsl:apply-template match="logo">
				<fo:external-graphic content-height = ".5in"  content-width = ".5in" >
					<xsl:attribute name="src" >
						<xsl:value-of select="logo" />
					</xsl:attribute>
				</fo:external-graphic>

			</xsl:apply-template>
		     	</fo:table-cell>

			<fo:table-cell />

		     	<fo:table-cell text-align="center" width="100%">
		     		<fo:block font-size="12pt" font-weight="bold" display-align="center"><xsl:value-of select="labelQuoteDetails"/></fo:block>
		     		<xsl:apply-template match="selfAddress">
			  		<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//name" /></fo:block>
                    <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address1" /></fo:block>
                    <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address2" /></fo:block>
			  		<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address3" /></fo:block>
			  		<fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address4" /></fo:block>
                    <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//cityStateZip" /></fo:block>
                    <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//phoneFax" /></fo:block>
			  	</xsl:apply-template>
		     	</fo:table-cell>

			<fo:table-cell />
		</fo:table-row>
	</fo:table-body>
	</fo:table >
	</fo:block>

<!--==============================-->
<!-- From and To addresses block  -->
<!-- Modified By Prabhanjan (12/24/2003)-->
<!--==============================-->


	<fo:table table-layout="fixed" width="100%" space-after="0.5cm">
		<fo:table-column />
		<fo:table-column column-width="2mm" />
		<fo:table-column column-width="64mm" />
		<fo:table-column column-width="2mm" />
		<fo:table-column />

		<fo:table-body>
			<fo:table-row>
				<fo:table-cell hyphenate="true" language = "en" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="orderByAddress"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell/>

				<fo:table-cell hyphenate="true" language = "en">
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="billToAddress"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell/>

				<fo:table-cell hyphenate="true" language = "en">
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="shipToAddress"/> </fo:block>
				</fo:table-cell>

			</fo:table-row>
		</fo:table-body>
	</fo:table>


<!--===============================-->
<!-- Information block             -->
<!-- Modified By Prabhanjan (12/24/2003)-->
<!--===============================-->


	<fo:block font-size="8pt" space-after="0.5cm">
		<xsl:apply-templates select="information"/>
	</fo:block>


<!--=============================== -->
<!-- Comments Instructions block    -->
<!--=============================== -->


	<fo:block font-size="8pt" font-weight="bold" space-after="0.5mm" text-decoration="underline">Comments:</fo:block>
        <fo:block font-size="8pt" background-color="#FFFFEE" space-after="0.5cm" > <xsl:value-of select="comments"/> </fo:block>

<!--=============================== -->
<!-- Line Items details block      -->
<!--=============================== -->

	<fo:block font-size="8pt" space-after="0.5cm">
	        <xsl:apply-templates select="lineItems"/>
        </fo:block>


<!--=============================== -->
<!-- End User details block      -->
<!--=============================== -->

	<fo:table table-layout="fixed" width="100%" space-after="1cm">
		<fo:table-column  column-width="10mm"/>
		<fo:table-column  column-width="50mm"/>
		<fo:table-column  column-width="20mm"/>

		<fo:table-body>
			<fo:table-row>
				<fo:table-cell>
					<fo:block font-size="8pt" > <xsl:apply-templates select="endUser"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell />
				<fo:table-cell>
					<fo:block font-size="8pt" > <xsl:apply-templates select="total"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="salesTax"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="freight"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="misc"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="balanceDue"/> </fo:block>
				</fo:table-cell>

			</fo:table-row>
		</fo:table-body>
	</fo:table>

    <fo:table table-layout="note" width="102%" space-after="1cm">
               <fo:table-column  column-width="100mm"/>
               <fo:table-body>
                   <fo:table-row>
                       <fo:table-cell>
                           <fo:block font-size="7pt" > <xsl:apply-templates select="notes"/> </fo:block>
                       </fo:table-cell>
                   </fo:table-row>
               </fo:table-body>
           </fo:table>

<fo:block id="endofdoc"></fo:block>
</fo:flow>

</fo:page-sequence>

    <fo:page-sequence master-reference="termsAndConditionsMasterName">
        <fo:flow flow-name="xsl-region-body">
            <fo:block><div style="page-break-before: always"/></fo:block>
            <fo:block font-size="8pt" space-after="2cm">
                <fo:table margin="2mm" table-layout="fixed"  width="100%">
                <fo:table-column  column-width="285mm"/>
                    <fo:table-body>
                        <fo:table-row>
                            <fo:table-cell>
                                <fo:block font-size="8pt" space-after="2cm"> <xsl:apply-templates select="termsAndConditions"/> </fo:block>
                                <!--<xsl:apply-template match="termsAndConditions">
                                <fo:external-graphic width="70cm" height="50cm" content-width="70cm" content-height="50cm" display-align="center" text-align="center">
                                    <xsl:attribute name="src">
                                        <xsl:value-of select="termsPage1"/>
                                    </xsl:attribute>
                                </fo:external-graphic>
                                </xsl:apply-template>-->
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:block>
        </fo:flow>
    </fo:page-sequence>


    <!--<fo:page-sequence master-reference="termsAndConditionsMasterName">
    <fo:flow flow-name="xsl-region-body">
    <fo:block><div style="page-break-before: always"/></fo:block>
    <fo:block font-size="8pt" space-after="2cm">
        <fo:table margin="2mm" table-layout="fixed"  width="100%">
        <fo:table-column  column-width="285mm"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell>
                        <xsl:apply-template match="termsPage1">
                        <fo:external-graphic width="70cm" height="50cm" content-width="70cm" content-height="50cm" display-align="center" text-align="center">
                            <xsl:attribute name="src">
                                <xsl:value-of select="termsPage1"/>
                            </xsl:attribute>
                        </fo:external-graphic>
                        </xsl:apply-template>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:block>
    </fo:flow>
    </fo:page-sequence>
-->

</fo:root>
</xsl:template>



<!-- ================================ -->
<!--	child element: Self Address     -->
<!-- ================================ -->
<!-- Modified By Prabhanjan (12/24/2003) -->

<xsl:template match="selfAddress">
	<fo:table width="100%" table-layout="fixed">
	<fo:table-column />
		<fo:table-body>
			<fo:table-row>
				<fo:table-cell text-align="center">

					<fo:block font-weight="bold">Self Address:</fo:block>
					<fo:block><xsl:value-of select="name"/></fo:block>
					<fo:block><xsl:value-of select="address1"/></fo:block>
					<fo:block><xsl:value-of select="address2"/></fo:block>
					<fo:block><xsl:value-of select="address3"/></fo:block>
					<fo:block><xsl:value-of select="phone"/></fo:block>
					<fo:block><xsl:value-of select="fax"/></fo:block>
					<fo:block>Email: <xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- ================================ -->
<!--  Child element: Order By Address  -->
<!-- ================================ -->
<!-- Modified By Prabhanjan (12/24/2003) -->

<xsl:template match="orderByAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold"><xsl:value-of select="labelOrderedBy"/> :</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" >

				<!--<fo:block><xsl:value-of select="name"/></fo:block>-->
                <fo:block><xsl:value-of select="address1"/></fo:block>
                <fo:block><xsl:value-of select="contactPerson"/></fo:block>
				<fo:block><xsl:value-of select="address2"/></fo:block>
				<fo:block><xsl:value-of select="address3"/></fo:block>
                <fo:block><xsl:value-of select="address4"/></fo:block>
                <fo:block><xsl:value-of select="city"/></fo:block>
                <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
				<fo:block><xsl:value-of select="phone"/></fo:block>
                <fo:block><xsl:value-of select="cell"/></fo:block>
				<fo:block><xsl:value-of select="fax"/></fo:block>
				<fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>



<!-- ================================ -->
<!--  Child element: Bill To Address  -->
<!-- ================================ -->
<!-- Modified By Prabhanjan (12/24/2003) -->


<xsl:template match="billToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Bill To:</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

                    <!--<fo:block><xsl:value-of select="name"/></fo:block>-->
                    <fo:block><xsl:value-of select="address1"/></fo:block>
                    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
                    <fo:block><xsl:value-of select="address2"/></fo:block>
                    <fo:block><xsl:value-of select="address3"/></fo:block>
                    <fo:block><xsl:value-of select="address4"/></fo:block>
                    <fo:block><xsl:value-of select="city"/></fo:block>
                    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
                    <fo:block><xsl:value-of select="phone"/></fo:block>
                    <fo:block><xsl:value-of select="cell"/></fo:block>
                    <fo:block><xsl:value-of select="fax"/></fo:block>
                    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>




<!-- =================================== -->
<!--	Child element: Ship To Address   -->
<!-- =================================== -->
<!-- Modified By Prabhanjan (12/24/2003) -->


<xsl:template match="shipToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Ship To:</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

                    <!--<fo:block><xsl:value-of select="name"/></fo:block>-->
                    <fo:block><xsl:value-of select="address1"/></fo:block>
                    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
                    <fo:block><xsl:value-of select="address2"/></fo:block>
                    <fo:block><xsl:value-of select="address3"/></fo:block>
                    <fo:block><xsl:value-of select="address4"/></fo:block>
                    <fo:block><xsl:value-of select="city"/></fo:block>
                    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
                    <fo:block><xsl:value-of select="phone"/></fo:block>
                    <fo:block><xsl:value-of select="cell"/></fo:block>
                    <fo:block><xsl:value-of select="fax"/></fo:block>
                    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>


<!-- =================================== -->
<!--	child element: Information       -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->






<xsl:template match="information">
	<fo:block font-size="7pt">
	<fo:table width="100%" table-layout="fixed">
		<fo:table-column />
		<fo:table-column column-width="2mm"/>
		<fo:table-column column-width="64mm"/>
		<fo:table-column column-width="2mm"/>
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.5cm" >

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column />
				<fo:table-column />

				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
                        <!--
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Customer Q#</fo:block>
						</fo:table-cell>
                        -->
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Quote#</fo:block>
						</fo:table-cell>
                        <fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left"><xsl:value-of select="labelOrderDate"/></fo:block>
						</fo:table-cell>

                    </fo:table-row>
					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
                        <!--
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="customerQ"/>
							</fo:block>
						</fo:table-cell>
                        -->
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="quotation"/>
							</fo:block>
						</fo:table-cell>
                        <fo:table-cell border="1pt double black" display-align="center">
                            <fo:block font-weight="bold" text-align="left">
                            <xsl:value-of select="orderDate"/>
                            </fo:block>
                        </fo:table-cell>


                    </fo:table-row>

				</fo:table-body>
			</fo:table>
			</fo:table-cell>

			<fo:table-cell />

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column />
				<fo:table-column />

				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Quotation Expires On </fo:block>
						 </fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Ship Via</fo:block>
						</fo:table-cell>

					</fo:table-row>
					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="expireDate"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="shipVia"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>

				</fo:table-body>
			</fo:table>
			</fo:table-cell>

			<fo:table-cell />

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column />
				<fo:table-column />
				<fo:table-column />
				<fo:table-column />

				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left"><xsl:value-of select="labelSalesPerson"/></fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left"><xsl:value-of select="labelRegionalRep"/></fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Del Terms</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Pay Terms</fo:block>
						</fo:table-cell>

					</fo:table-row>
					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="salesPerson"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="regionalRep"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="delTerms"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="payTerms"/>
							</fo:block>
						</fo:table-cell>

					</fo:table-row>

				</fo:table-body>
			</fo:table>
		</fo:table-cell>
	</fo:table-row>

	</fo:table-body>
	</fo:table>
        </fo:block>
</xsl:template>

<!-- =================================== -->
<!--	child element: LineItems. 	     -->
<!--    Modified by Prabhajnan           -->
<!-- =================================== -->

<xsl:template match="lineItems">
	<fo:block font-size="7pt">
        <fo:table margin="1mm" width="100%" table-layout="fixed">
        <fo:table-column column-width="8mm"/>
        <fo:table-column column-width="10mm"/>
        <xsl:if test="labelMinOrderQuantity!=''">
            <fo:table-column column-width="8mm"/>
        </xsl:if>
        <fo:table-column column-width="5mm"/>
        <xsl:if test="noOfDynaColoums='4'">
            <fo:table-column column-width="20mm"/>
            <fo:table-column column-width="20mm"/>
            <fo:table-column column-width="16mm"/>
	    </xsl:if>
        <xsl:if test="noOfDynaColoums='3'">    
            <fo:table-column column-width="23mm"/>
            <fo:table-column column-width="22mm"/>
            <fo:table-column column-width="19mm"/>
	    </xsl:if>
        <xsl:if test="noOfDynaColoums='2'">
            <fo:table-column column-width="28mm"/>
            <fo:table-column column-width="29mm"/>
            <fo:table-column column-width="21mm"/>
	    </xsl:if>
        <xsl:if test="noOfDynaColoums='1'">
            <fo:table-column column-width="32mm"/>
            <fo:table-column column-width="32mm"/>
            <fo:table-column column-width="28mm"/>
	    </xsl:if>
        <xsl:if test="noOfDynaColoums='0'">
            <fo:table-column column-width="35mm"/>
            <fo:table-column column-width="35mm"/>
            <fo:table-column column-width="33mm"/>
	    </xsl:if>
            <fo:table-column column-width="14mm"/>
            <fo:table-column column-width="16mm"/>
            <fo:table-column column-width="10mm"/>

            <xsl:if test="labelRequestedPrice!=''">
                <fo:table-column column-width="14mm"/>
            </xsl:if>
            <xsl:if test="labelCustResalePrice!=''">
                <fo:table-column column-width="14mm"/>
            </xsl:if>

            <fo:table-column column-width="14mm"/>

            <xsl:if test="labelSuggResalePrice!=''">
                <fo:table-column column-width="14mm"/>
            </xsl:if>

            <fo:table-column column-width="18mm"/>

            <fo:table-body>
			<fo:table-row height="0.6cm" background-color="#DEE1E2">
				<fo:table-cell border="1pt double black" display-align="center" >
			    		<fo:block font-weight="bold" text-align="center">PO Line#</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Req Qty</fo:block>
	  			</fo:table-cell>
                <xsl:if test="labelMinOrderQuantity!=''">
                    <fo:table-cell border="1pt double black" display-align="center">
					    <fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelMinOrderQuantity"/></fo:block>
				    </fo:table-cell>
                </xsl:if>
                  <fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">UM</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelMfgPartNumber"/></fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelCustPartNumber"/></fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Description</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Requested Dock Date</fo:block>
				</fo:table-cell>
                <fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Lead Time</fo:block>
				</fo:table-cell>
                   <fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Taxable</fo:block>
					<fo:block font-weight="bold" text-align="center">Yes or No</fo:block>
				</fo:table-cell>
                <xsl:if test="labelRequestedPrice!=''">
                    <fo:table-cell border="1pt double black" display-align="center">
					    <fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelRequestedPrice"/></fo:block>
				    </fo:table-cell>
                </xsl:if>
                <xsl:if test="labelCustResalePrice!=''">
                    <fo:table-cell border="1pt double black" display-align="center">
					    <fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelCustResalePrice"/></fo:block>
				    </fo:table-cell>
                </xsl:if>
               <fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelPrice"/></fo:block>
				</fo:table-cell>
                <xsl:if test="labelSuggResalePrice!=''">
                    <fo:table-cell border="1pt double black" display-align="center">
					    <fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelSuggResalePrice"/></fo:block>
				    </fo:table-cell>
                </xsl:if>
               <fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Extended Price</fo:block>
				</fo:table-cell>
			</fo:table-row>

            <xsl:variable name="subTotalColSpan" select="/quotationAcknowledgement/lineItems/subTotaColSpan"/>
            <xsl:for-each select="/quotationAcknowledgement/lineItems/group">
                    <xsl:for-each select="lineItem">
                        <fo:table-row height="0.4cm" background-color="#FFFFEE">
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="poLineItem"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="reqQty"/>
                                </fo:block>
                            </fo:table-cell>
                            <xsl:if test="../../labelMinOrderQuantity!=''">
                                <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                    <fo:block font-weight="bold" text-align="center">
                                        <xsl:value-of select="minOrderQuantity"/>
                                    </fo:block>
                                </fo:table-cell>
                            </xsl:if>
                            <fo:table-cell border="1pt double black" display-align="center" >
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="um"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                <fo:block font-weight="bold" text-align="left">
                                <xsl:value-of select="mfgPartNumber"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                <fo:block font-weight="bold" text-align="left">
                                <xsl:value-of select="customerPartNumber"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                <fo:block font-weight="bold" text-align="left">
                                <xsl:value-of select="description"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="requestDate"/>
                                </fo:block>
                            </fo:table-cell>

                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="leadTime"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="taxable"/>
                                </fo:block>
                            </fo:table-cell>

                            <xsl:if test="../../labelRequestedPrice!=''">
                                <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                    <fo:block font-weight="bold" text-align="right">
                                        <xsl:value-of select="requestedPrice"/>
                                    </fo:block>
                                </fo:table-cell>
                            </xsl:if>

                            <xsl:if test="../../labelCustResalePrice!=''">
                                <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                    <fo:block font-weight="bold" text-align="right">
                                        <xsl:value-of select="custResalePrice"/>
                                    </fo:block>
                                </fo:table-cell>
                            </xsl:if>

                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                <fo:block font-weight="bold" text-align="right">
                                <xsl:value-of select="unitPrice"/>
                                </fo:block>
                            </fo:table-cell>

                            <xsl:if test="../../labelSuggResalePrice!=''">
                                <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                    <fo:block font-weight="bold" text-align="right">
                                        <xsl:value-of select="suggResalePrice"/>
                                    </fo:block>
                                </fo:table-cell>
                            </xsl:if>

                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                                <fo:block font-weight="bold" text-align="right" >
                                <xsl:value-of select="extendedPrice"/>
                                </fo:block>
                            </fo:table-cell>

                        </fo:table-row>

                    </xsl:for-each>

                <fo:table-row height="0.4cm" background-color="#FFFFFF">                   
                    <fo:table-cell number-columns-spanned="1" border="1pt double black" display-align="center" >
                        <fo:block font-weight="bold" text-align="right">Sub Total</fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                        <fo:block font-weight="bold" text-align="center"><xsl:value-of select="subTotalQty"/></fo:block>
                    </fo:table-cell>
                    <fo:table-cell number-columns-spanned="{$subTotalColSpan}" border="1pt double black" display-align="center" >
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language = "en">
                        <fo:block font-weight="bold" text-align="right"><xsl:value-of select="subTotalAmt"/></fo:block>
                    </fo:table-cell>
                </fo:table-row>
           </xsl:for-each>
		</fo:table-body>
	</fo:table>
	</fo:block>
</xsl:template>

<!-- =================================== -->
<!--	child element: End User      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="endUser">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column  column-width="36mm"/>
		<fo:table-column  column-width="36mm"/>
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				    <fo:block font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/endCustomerLabel"/></fo:block>
				</fo:table-cell>
                <fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				    <fo:block font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/endUserLabel"/></fo:block>
				</fo:table-cell>
            </fo:table-row>
			<fo:table-row height="0.5cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="center">
					<fo:block hyphenate="true" language = "en"><xsl:value-of select="/quotationAcknowledgement/endCustomer"/></fo:block>
				</fo:table-cell>
                <fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="center">
					<fo:block hyphenate="true" language = "en"><xsl:value-of select="/quotationAcknowledgement/endUser"/></fo:block>
				</fo:table-cell>
            </fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Total      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="total">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold"  border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Total</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/quotationAcknowledgement/total"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Sales Tax      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="salesTax">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Sales Tax</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/quotationAcknowledgement/salesTax"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>


<!-- =================================== -->
<!--	child element: Freight      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="freight">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Freight</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/quotationAcknowledgement/freight"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>


<!-- =================================== -->
<!--	child element: Misc      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="misc">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold" ><xsl:value-of select="/quotationAcknowledgement/misc/@name"/></fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/quotationAcknowledgement/misc"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Balance Due      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="balanceDue">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Balance Due</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/quotationAcknowledgement/balanceDue"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

  <xsl:template match="notes">
   <xsl:if test="termsLabel!=''">
    <fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		    <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" display-align="center">
					<fo:block ><xsl:value-of select="termsLabel"/>
                    </fo:block>
				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
   </xsl:if>
</xsl:template>

<!-- =================================== -->
<!--	child element: Terms And Conditions      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="termsAndConditions">
    <xsl:if test="isTermsFromDB='false'">
        <fo:external-graphic width="70cm" height="50cm" content-width="70cm" content-height="50cm" display-align="center" text-align="center">
                <xsl:attribute name="src">
                    <xsl:value-of select="termsPage1"/>
                </xsl:attribute>
        </fo:external-graphic>
    </xsl:if>
    <xsl:if test="isTermsFromDB='true'">
    <fo:table margin="2mm" width="102%" table-layout="fixed">
		<fo:table-column />
		<!-- <fo:table-column column-width="5mm"/> -->
		<!-- <fo:table-column /> -->
            <fo:table-body>
			<fo:table-row height="0.4cm">
                <fo:table-cell>
                        <fo:block> <xsl:apply-templates select="termsfromdb"/> </fo:block>
                </fo:table-cell>
                <!--
                    <fo:table-cell />
                    <fo:table-cell>
                        <fo:block> <xsl:apply-templates select="term2"/> </fo:block>
                    </fo:table-cell>
                -->
			</fo:table-row>
		</fo:table-body>
	</fo:table>
    </xsl:if>
</xsl:template>

<!-- =================================== -->
<!--	child element: Term1      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="term1">
	<fo:table margin="0.5mm" width="100%" table-layout="fixed"  background-color="#DEE1E2" font-size="6pt" >
		<fo:table-column />

	        <fo:table-body>
			<xsl:for-each select="/quotationAcknowledgement/termsAndConditions/term1/termAndCondition">
			<fo:table-row height="0.4cm">
				<fo:table-cell hyphenate="true" language = "en">
					<fo:block text-align="justify">
						<fo:inline text-decoration="underline"><xsl:value-of select="title" /></fo:inline>
						<xsl:value-of select="description"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			</xsl:for-each>
		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Term2      -->
<!--   Commented By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

    <xsl:template match="termsfromdb">
    <fo:block font-size="7pt"  text-align="center" space-after="0.5cm">
                <xsl:apply-template match="/quotationAcknowledgement/selfAddress">
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/selfAddress//name" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/selfAddress//address1" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/selfAddress//address2" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/selfAddress//address3" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/selfAddress//address4" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/selfAddress//cityStateZip" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/quotationAcknowledgement/selfAddress//phoneFax" /></fo:block>
			  	    </xsl:apply-template>
            </fo:block>
     <fo:block font-size="12pt"  text-align="center" space-after="0.5cm">
                TERMS AND CONDITIONS OF SALES</fo:block>
    <fo:table margin="0.5mm" width="102%" table-layout="fixed"  background-color="#DEE1E2" font-size="6pt" >
		<fo:table-column />
	        <fo:table-body>
            <xsl:for-each select="/quotationAcknowledgement/termsAndConditions/termsfromdb/termAndConditionFromDB">
			<fo:table-row height="0.4cm">
				<fo:table-cell hyphenate="true" language="en" >
					<fo:block text-align="justify" space-after="0.3cm">
						<fo:inline text-decoration="underline"><xsl:value-of select="title" /></fo:inline>
						<xsl:for-each select="description/subDescription">
                            <fo:block text-align="justify" >
                            <xsl:value-of select="subDescriptionValue"/>
                            </fo:block>
                        </xsl:for-each>
                    </fo:block>
				</fo:table-cell>
			</fo:table-row>
			</xsl:for-each>
		</fo:table-body>
	</fo:table>
</xsl:template>
<!--
<xsl:template match="term2">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2" font-size="6pt" >
		<fo:table-column />

	        <fo:table-body>
			<xsl:for-each select="/quotationAcknowledgement/termsAndConditions/term2/termAndCondition">
			<fo:table-row height="0.4cm">
				<fo:table-cell>
					<fo:block text-align="justify">
						<fo:inline text-decoration="underline"><xsl:value-of select="title" /></fo:inline>
						<xsl:value-of select="description"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			</xsl:for-each>
		</fo:table-body>
	</fo:table>
</xsl:template>

-->

<!-- =================================== -->
<!--	END of Document		         -->
<!-- =================================== -->

</xsl:stylesheet>